package com.xmy.cultivate.feign.erp_admin;

import com.xmy.cultivate.config.FeignConfig;
import com.xmy.cultivate.entity.OrderApply;
import com.xmy.cultivate.entity.RecordCourse;
import com.xmy.cultivate.entity.RepairCourse;
import com.xmy.cultivate.respons.PlanShutNum;
import com.xmy.cultivate.respons.ResStudentClassType;
import com.xmy.cultivate.util.Code;
import com.xmy.cultivate.util.PageResult;
import com.xmy.cultivate.util.Result;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

@FeignClient(value = "cultivate-admin",configuration = FeignConfig.class)
public interface IAdminFeignClient {

    /**
     * 调整到课状态
     *
     */
    @RequestMapping(value = "/api/recordCourse/checkRecordStatus", method = RequestMethod.PUT)
    public ResponseEntity<Object> checkRecordStatus(@RequestBody RecordCourse recordCourse);

    /**
     * 手动消课(满15次后)
     * @param recordCourseParam
     * @return
     */
    @PostMapping("/api/recordCourse/recordActionConsume")
    public Result recordActionConsume(@RequestBody RecordCourse recordCourseParam);

    @PostMapping("/api/recordCourse/tryListenBuckleHouse")
    public Result tryListenBuckleHouse(@RequestBody RecordCourse recordCourseParam);

    @PostMapping("/api/apply/")
    public Result orderSave(@RequestBody OrderApply orderApply);

    @GetMapping("/api/student/signUpStu")
    public Result studentSignUpStu(@RequestParam Map reMap,
                            @RequestParam(value = "excludeStudentId",required = false) Long excludeStudentId);

    @GetMapping("/api/apply/getLessonByStuInfoId/{studentId}")
    public Result applyGetLessonByStuInfoId(@PathVariable(value = "studentId") Long studentId,
                                            @RequestParam(value = "lessonType", defaultValue = "1", required = false) String lessonType);


    @GetMapping("/api/student/{id}")
    public Result findById(@PathVariable(value = "id") Long id);

    @GetMapping("/api/apply/checkCourse")
    public Result applyCheckCourse(@RequestParam Map<String, String> reMap,
                              @RequestParam(value = "schoolId", defaultValue = "") Long schoolId,
                              @RequestParam(value = "yearClassIdList", defaultValue = "") String[] yearClassIdList,
                              @RequestParam(value = "subjectsId", defaultValue = "") String[] subjectsIdArr,
                              @RequestParam(value = "quarterNumList", defaultValue = "") String[] quarterNumList,
                              @RequestParam(value = "lessonType", defaultValue = "1", required = false) String lessonType);


    @ApiOperation("获取优惠卷")
    @GetMapping("/api/dict")
    public Result getDict(@RequestParam Map reMap);


    @GetMapping("/api/studentAtSchool/allSchool")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name" , value = "学校名" , required = false , dataType = "String"),
            @ApiImplicitParam(name = "pageNum" , value = "分页数" , required = true, dataType = "String"),
            @ApiImplicitParam(name = "regional" , value = "所在区域" , required = true , dataType = "String"),
            @ApiImplicitParam(name = "pageSize" , value = "分页尺寸" , required = true, dataType = "String"),
            @ApiImplicitParam(name = "gradeSection" , value = "学段" , required = true, dataType = "String"),
    })
    @ApiOperation("分页查询所有学校信息")
    public Result studentAtSchoolAllSchool(@RequestParam Map reMap,
                                           @RequestParam(value = "gradeSection",required = false,defaultValue = "") String gradeSection,
                                           @RequestParam(value = "yearClassId",required = false,defaultValue = "") String yearClassId);


    @GetMapping("/api/organization/findAllSchool")
    public Result organizationFindAllSchool(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                @RequestParam(value = "pageSize", defaultValue = "-1") Integer pageSize,
                                @RequestParam(value = "type", defaultValue = "") String type,
                                @RequestParam(value = "name", defaultValue = "", required = false) String name,
                                @RequestParam(value = "status", defaultValue = "") String status,
                                @RequestParam(value = "schoolId", defaultValue = "") String schoolId);

    @ApiOperation("查询学生的亲属")
    @GetMapping("/api/student/kinsfolk")
    public Result studentGetKinsfolk(@RequestParam Map reMap);

    @ApiOperation("获取学生和课程")
    @GetMapping("/api/student/getStudentIdAndCourseId")
    public Result studentGetStudentIdAndCourseId(@RequestParam Map reMap);


    @PostMapping("/api/apply/isAddPass")
    @ApiOperation("新报/续费 提前前，判断是否有相同的课次订单提交过")
    public Result isAddPass(@RequestBody OrderApply orderApply);
}
